package appapi.service;

import appapi.Request.DeviceBlackBoxPageReq;
import appapi.Request.bridge.BlackBoxListReq;
import appapi.Vo.brider.AddIotDevice;
import appapi.Vo.brider.BlackBoxVO;
import appapi.Vo.brider.DeviceVO;
import appapi.Vo.brider.EditDevice;
import appapi.common.ResponseBean;
import appapi.entity.basic.UserInfo;
import appapi.entity.bridge.IotDevice;
import appapi.entity.record.RealDataEntity;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hlm
 * @date
 * @description: 黑匣子
 */
@Repository
public interface DeviceBlackBoxService extends IService<IotDevice> {

    /**
     * 分页查询黑匣子列表
     *
     * @return
     */
    IPage<DeviceVO> getBoxListByPage(DeviceBlackBoxPageReq req);

    /**
     * 查询黑匣子列表
     *
     * @return
     */
    List<DeviceVO> getBoxList(DeviceBlackBoxPageReq req);

    /**
     * 启用
     *
     * @return
     */
    void insertDevice(AddIotDevice addIotDevice , UserInfo userInfo);

    /**
     * 编辑黑匣子
     *
     * @return
     */
    void editDevice(EditDevice editDevice , UserInfo userInfo);

    /**
     * 删除黑匣子
     *
     * @return
     */
    void delDevice(Long deviceId);

    /**
     * 停用
     *
     * @return
     */
    ResponseBean stopDevice(Long deviceId , UserInfo userInfo);


    /**
     * 详情
     *
     * @return
     */
    ResponseBean<DeviceVO> getDeviceModel(Long deviceId);

    /**
     * 更新终端在线状态
     * @param deviceSn
     * @param deviceStatus
     * @return
     */
    Integer updateDeviceStatus(String deviceSn,String deviceStatus,Long timestamp);

    /**
     * 查询未绑定黑匣子列表
     *
     * @return
     */
    List<BlackBoxVO> getBlackBoxList(BlackBoxListReq req);

    Integer addRealData(RealDataEntity entity);
}
